package com.cx.controller;

import com.cx.domain.Person;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.Period;

@RestController
public class TestController {
    @RequestMapping("/hello")
    public String hello(){
        return "hello chenxu22";
    }

    @Value("${person.addr}")
    public String addr;

    @GetMapping("/addr")
    public String addr(){
        return addr;
    }

    @Autowired
    private Person person;
    @GetMapping("/person")
    public Person showPerson(){
        System.out.println(person);
        return person;
    }
}
